<h1>Listing comments</h1>

<table>
  <tr>
    <th>Message</th>
    <th>User</th>
    <th>Created at</th>
    <th>Body</th>
  </tr>
  
<% for comments in @comments %>
  <tr>
    <td><%=h comments.message_id %></td>
    <td><%=h comments.user_id %></td>
    <td><%=h comments.created_at %></td>
    <td><%=h comments.body %></td>
    <td><%= link_to 'Show', comments_path(comments) %></td>
    <td><%= link_to 'Edit', edit_comments_path(comments) %></td>
    <td><%= link_to 'Destroy', comments_path(comments), :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New comments', new_comments_path %>